<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Member\PublicController;
use App\Http\Controllers\Member\ManagerController;
use App\Http\Controllers\Member\AccountController;
use App\Http\Controllers\API\APIController;

//用户 无需权限
Route::group( [], function () {
    //test
    Route::get( '/queue', [ PublicController::class, 'queue' ] );




	//无访问权限
	Route::get( 'no_access', [ PublicController::class, 'noAccess' ] )->name( 'no_access' );
	Route::any( 'test', [ APIController::class, 'test' ] );
	Route::any( 'test/string_replace', [ APIController::class, 'String_replace' ] );
	//首页
	Route::get( '/', [ PublicController::class, 'home' ] );
	Route::any( '/domain', [ PublicController::class, 'domain' ] );
	Route::get( '/notice', [ PublicController::class, 'notice' ] );


	//支付宝支付

	Route::get( 'alipay/query', [ \App\Http\Controllers\Member\FundsController::class, 'AliPay_Query' ] ); //订单查询
	Route::get( 'alipay/pay_status',
		[ \App\Http\Controllers\Member\FundsController::class, 'AliPay_PayStatus' ] ); //订单查询
	Route::get( 'alipay/refund', [ \App\Http\Controllers\Member\FundsController::class, 'AliPay_Refund' ] );  //退款
	Route::post( 'alipay/notify_url',
		[ \App\Http\Controllers\Member\FundsController::class, 'AliPay_Notify_Url' ] ); //回调
	Route::get( 'alipay/return_url',
		[ \App\Http\Controllers\Member\FundsController::class, 'AliPay_Return_Url' ] ); //成功跳转

	//账户管理
	Route::get( 'account/auth/email/check',
		[ \App\Http\Controllers\Member\AccountController::class, 'authEmailCheck' ] );


//	//聊天室
//	Route::get( 'layim/mobile', [ ChatPublic::class, 'layimMobile' ] );     //PC端入口
//	Route::get( 'layim', [ ChatPublic::class, 'layim' ] );     //移动端入口
//	Route::post( 'chat/bind', [ ChatPublic::class, 'bindClientId' ] );      //绑定client_id
//	Route::get( 'chat/list', [ ChatPublic::class, 'getList' ] );      //获取好友&群组
//	Route::post( 'chat/search', [ ChatPublic::class, 'search' ] );      //搜索 好友&群
//	Route::post( 'chat/add', [ ChatPublic::class, 'add' ] );      //添加 好友&群
//	Route::get( 'chat/add_list', [ ChatPublic::class, 'addList' ] );      //添加列表 好友&群
//	Route::post( 'chat/add_assent', [ ChatPublic::class, 'addAssent' ] );      //同意请求
//	Route::post( 'chat/upload_img', [ ChatPublic::class, 'uploadImg' ] );      //上传图片
//	Route::post( 'chat/upload_file', [ ChatPublic::class, 'uploadFile' ] );      //上传文件
} );
//用户 需要权限
Route::group( [ 'middleware' => [ 'AuthAdmin' ] ], function () {
	Route::any( 'gongdan', [ PublicController::class, 'gongdan' ] );
	Route::any( 'dgongdan', [ PublicController::class, 'dgongdan' ] );
	Route::any( 'gdlist', [ PublicController::class, 'gdlist' ] );
	Route::any( 'gdinfo', [ PublicController::class, 'gdinfo' ] );

	//域名管理
	Route::any( 'domain/list', [ \App\Http\Controllers\Member\DomainController::class, 'list' ] );
	Route::any( 'domain/tpl', [ \App\Http\Controllers\Member\DomainController::class, 'tpl' ] );
	Route::any( 'domain/tpl/add', [ \App\Http\Controllers\Member\DomainController::class, 'tplAdd' ] );
	Route::any( 'domain/group', [ \App\Http\Controllers\Member\DomainController::class, 'group' ] );
	Route::any( 'domain/group/setup', [ \App\Http\Controllers\Member\DomainController::class, 'groupSetup' ] );
	Route::any( 'domain/zhuanchu', [ \App\Http\Controllers\Member\DomainController::class, 'zhuanchu' ] );
	Route::any( 'domain/zhuanchu/list', [ \App\Http\Controllers\Member\DomainController::class, 'zhuanchuList' ] );
	Route::any( 'domain/push', [ \App\Http\Controllers\Member\DomainController::class, 'push' ] );
	Route::any( 'domain/push/send', [ \App\Http\Controllers\Member\DomainController::class, 'pushSend' ] );
	Route::any( 'domain/push/get', [ \App\Http\Controllers\Member\DomainController::class, 'pushGet' ] );
	Route::any( 'domain/plcz', [ \App\Http\Controllers\Member\DomainController::class, 'plcz' ] );
	Route::any( 'domain/plcz/dns', [ \App\Http\Controllers\Member\DomainController::class, 'plczDns' ] );
	Route::any( 'domain/plcz/guohu', [ \App\Http\Controllers\Member\DomainController::class, 'plczGuohu' ] );
	Route::any( 'domain/plcz/jiexi', [ \App\Http\Controllers\Member\DomainController::class, 'plczJiexi' ] );
	Route::any( 'domain/plcz/jieguo', [ \App\Http\Controllers\Member\DomainController::class, 'plczJieguo' ] );

	//资金管理
	Route::get( 'pay/alipay', [ \App\Http\Controllers\Member\FundsController::class, 'AliPay' ] );

	Route::any( 'funds/recharge', [ \App\Http\Controllers\Member\FundsController::class, 'recharge' ] );
	Route::any( 'funds/list', [ \App\Http\Controllers\Member\FundsController::class, 'list' ] );
	Route::any( 'funds/withdrawal', [ \App\Http\Controllers\Member\FundsController::class, 'withdrawal' ] );
	Route::any( 'funds/withdrawal/list', [ \App\Http\Controllers\Member\FundsController::class, 'withdrawalList' ] );
	Route::any( 'funds/withdrawal/setting',
		[ \App\Http\Controllers\Member\FundsController::class, 'withdrawalSetting' ] );
	Route::any( 'funds/invoice', [ \App\Http\Controllers\Member\FundsController::class, 'invoice' ] );
	Route::any( 'funds/invoice/list', [ \App\Http\Controllers\Member\FundsController::class, 'invoiceList' ] );

	//账户管理
	Route::any( 'account/info', [ AccountController::class, 'info' ] );
	Route::any( 'account/safe', [ AccountController::class, 'safe' ] );
	Route::any( 'account/certification', [ AccountController::class, 'certification' ] );
	Route::any( 'account/auth/email', [ AccountController::class, 'authEmail' ] );
	Route::any( 'account/auth/email/add', [ AccountController::class, 'authEmailAdd' ] );
	Route::any( 'account/auth/personal', [ AccountController::class, 'authPersonal' ] );
	Route::any( 'account/auth/personal/add', [ AccountController::class, 'authPersonalAdd' ] );
	Route::post( 'account/auth/personal/del', [ AccountController::class, 'authPersonalDel' ] );
	Route::any( 'account/auth/company', [ AccountController::class, 'authCompany' ] );
	Route::any( 'account/auth/company/add', [ AccountController::class, 'authCompanyAdd' ] );
	Route::any( 'account/auth/company/del', [ AccountController::class, 'authCompanyDel' ] );
	Route::any( 'account/edit/pw', [ AccountController::class, 'editPW' ] );
	Route::post( 'upload', [ AccountController::class, 'uploadImage' ] );

} );


//管理员 无需权限
Route::group( [ 'prefix' => 'member', ], function () {
	//登录注册
	Route::any( 'login', [ PublicController::class, 'login' ] )->name( 'manager_login' );   //登录
	Route::any( 'reg', [ PublicController::class, 'reg' ] )->name( 'manager_reg' ); //注册
	Route::any( 'zhaohuipw', [ PublicController::class, 'zhaohuipw' ] );       //发送邮件
	Route::any( 'password/reset', [ PublicController::class, 'passwordReset' ] );       //重置密码
	//Route::any( 'forget', [ PublicController::class, 'forget' ] )->name( 'manager_forget' );
//找回密码
	//Route::any( 'password/reset', 'User\PublicController@passwordReset' );  // 重置密码
//	Route::any( 'password/forget', 'User\PublicController@passwordForget' );  // 找回密码
//	Route::any( 'password/send_email', 'User\PublicController@passwordSendEmail' )->middleware( 'throttle:10,5' ); //发送验证邮件
	Route::any( 'send_sms', [ PublicController::class, 'sendSMS' ] )
	     ->middleware( 'throttle:10,5' ); //发送短信
} );


// 管理员 需要权限
Route::group( [ 'prefix' => 'member', 'middleware' => [ 'AuthAdmin' ] ], function () {
	//管理首页
	Route::get( '/', [ PublicController::class, 'index' ] )->name( 'manager_index' );
	//欢迎页面
	Route::get( 'welcome', [ PublicController::class, 'welcome' ] );
	//管理员退出
	Route::get( 'logout', [ PublicController::class, 'logout' ] )->name( 'manager_logout' );


	//会员管理
	//文件上传
	Route::any( '/manager/upload/invoice', [ ManagerController::class, 'uploadInvoice' ] );


	Route::any( '/manager/user', [ ManagerController::class, 'user' ] );
	Route::any( '/manager/user/blacklist', [ ManagerController::class, 'user_blacklist' ] );
	Route::post( '/manager/user/recharge', [ ManagerController::class, 'user_recharge' ] );
	Route::post( '/manager/user/status', [ ManagerController::class, 'user_status' ] );

	//提现管理
	Route::any( '/manager/funds/withdrawal', [ ManagerController::class, 'funds_withdrawal' ] );
	Route::post( '/manager/funds/withdrawal/status', [ ManagerController::class, 'funds_withdrawal_status' ] );
	Route::post( '/manager/funds/withdrawal/value', [ ManagerController::class, 'funds_withdrawal_value' ] );

	//发票管理
	Route::any( '/manager/funds/invoice', [ ManagerController::class, 'funds_invoice' ] );
	Route::post( '/manager/funds/invoice/save', [ ManagerController::class, 'funds_invoice_save' ] );
	Route::post( '/manager/funds/invoice/email', [ ManagerController::class, 'funds_invoice_email' ] );

	//现金日志
	Route::any( '/manager/funds/cash', [ ManagerController::class, 'funds_cash' ] );

    //域名归纳 -- 用户
    Route::any( '/domain/induce/index', [ \App\Http\Controllers\Member\DomainInduceController::class, 'index' ] );

    //域名归纳  -- 管理
    Route::any( '/manager/domain/induce', [ \App\Http\Controllers\Member\DomainInduceController::class, 'induce' ] );
    Route::post( '/manager/domain/induce/save', [ \App\Http\Controllers\Member\DomainInduceController::class, 'induce_save' ] );
    Route::post( '/manager/domain/induce/upload', [ \App\Http\Controllers\Member\DomainInduceController::class, 'uploadExcel' ] );
    Route::get( '/manager/domain/induce/import', [\App\Http\Controllers\Member\DomainInduceController::class, 'import' ] ); // excel
    Route::get( '/manager/domain/induce/import/status', [\App\Http\Controllers\Member\DomainInduceController::class, 'import_status' ] ); // excel

    Route::get( '/manager/domain/induce/export', [\App\Http\Controllers\Member\DomainInduceController::class, 'export' ] ); // excel

    Route::any( '/manager/domain/induce/condition', [ \App\Http\Controllers\Member\DomainInduceController::class, 'condition' ] );
    Route::post( '/manager/domain/induce/condition/create', [ \App\Http\Controllers\Member\DomainInduceController::class, 'condition_create' ] );
    Route::post( '/manager/domain/induce/condition/del', [ \App\Http\Controllers\Member\DomainInduceController::class, 'condition_del' ] );
    Route::post( '/manager/domain/induce/condition/save', [ \App\Http\Controllers\Member\DomainInduceController::class, 'condition_save' ] );

    Route::get( '/manager/domain/induce/init/key_name', [ \App\Http\Controllers\Member\DomainInduceController::class, 'initKeyName' ] );

	//网站设置
	Route::any( '/manager/setting', [ ManagerController::class, 'setting' ] );
	Route::post( '/manager/setting/edit', [ ManagerController::class, 'setting_edit' ] );


	Route::any( '/manager/funds/recharge', [ ManagerController::class, 'funds_recharge' ] );

	Route::get( '/manager/search', [ ManagerController::class, 'managerSearch' ] );
	Route::get( '/manager/form', [ ManagerController::class, 'managerForm' ] );
	Route::get( '/user/list', [ ManagerController::class, 'userList' ] );
	Route::get( '/user/search', [ ManagerController::class, 'userSearch' ] );
	Route::get( '/user/form', [ ManagerController::class, 'userForm' ] );
	Route::get( '/manager/role', [ ManagerController::class, 'role' ] );
	Route::get( '/manager/roleform', [ ManagerController::class, 'roleForm' ] );



	//角色管理
	Route::get( '/role/list', 'Admin\RBACController@RoleList' );
	Route::any( '/role/add', 'Admin\RBACController@RoleAdd' );
	Route::any( '/role/edit', 'Admin\RBACController@RoleEdit' );
	Route::post( '/role/delete', 'Admin\RBACController@RoleDelete' );
	Route::any( '/role/auth', 'Admin\RBACController@RoleAuth' );
	Route::get( '/role/search', 'Admin\RBACController@RoleSearch' );


	//权限管理
	Route::get( '/permission/list', 'Admin\RBACController@PermissionList' );
	Route::any( '/permission/add', 'Admin\RBACController@PermissionAdd' );
	Route::any( '/permission/edit', 'Admin\RBACController@PermissionEdit' );
	Route::post( '/permission/delete', 'Admin\RBACController@PermissionDelete' );
	Route::get( '/permission/search', 'Admin\RBACController@PermissionSearch' );

	//反馈管理
	Route::get( '/feedback/list', 'Admin\ServiceCenterController@FeedbackList' );
	Route::any( '/feedback/show', 'Admin\ServiceCenterController@FeedbackShow' );
	Route::post( '/feedback/delete',
		'Admin\ServiceCenterController@FeedbackDelete' );
	Route::post( '/feedback/multi_delete',
		'Admin\ServiceCenterController@FeedbackMultiDelete' );
	Route::post( '/feedback/status',
		'Admin\ServiceCenterController@FeedbackStatus' );

} );


